﻿@model IEnumerable<FlyingClub.Models.Flight>

@{
    ViewBag.Title = "Liste des vols";
}

<h1>@ViewBag.Title</h1>

<table class="flights-tab">
    <tbody>
        <tr>
            <td>Date de départ</td>
            <td>Aéroport de départ</td>
            <td>Date d'arrivée</td>
            <td>Aéroport d'arrivée</td>
            <td>Pilote</td>
            <td>Etudiant</td>
            <td>Transaction</td>
            <td>Avion</td>
            <td></td>
            <td></td>
            <td></td>
        </tr>

@foreach (var item in Model) {
        <tr>
            <td>@Html.DisplayFor(modelItem => item.DepartureDate)</td>
            <td>@Html.DisplayFor(modelItem => item.DepartureAirfield)</td>
            <td>@Html.DisplayFor(modelItem => item.ArrivalDate)</td>
            <td>@Html.DisplayFor(modelItem => item.ArrivalAirfield)</td>
            <td>@Html.DisplayFor(modelItem => item.Pilot.Firstname) @Html.DisplayFor(modelItem => item.Pilot.Lastname)</td>
            <td>@Html.DisplayFor(modelItem => item.Student.Firstname) @Html.DisplayFor(modelItem => item.Student.Lastname)</td>
            <td>@Html.DisplayFor(modelItem => item.Transaction.Description)</td>
            <td>@Html.DisplayFor(modelItem => item.Plane.Name) @Html.DisplayFor(modelItem => item.Plane.Number)</td>
            <td><a href="/Flights/Details/@item.ID#admin"><img src="@Url.Content("~/Content/images/nameplate.png")" alt="Détails" /></a></td>
            <td><a href="/Flights/Edit/@item.ID#admin"><img src="@Url.Content("~/Content/images/pen.png")" alt="Editer" /></a></td>
            <td><a href="/Flights/Delete/@item.ID#admin"><img src="@Url.Content("~/Content/images/remove.png")" alt="Supprimer" /></a></td>
        </tr>
}
    </tbody>
</table>
